package com.hu.video.controller;
import com.hu.video.entity.dto.UserStateDTO;
import com.hu.video.service.IUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;

@RestController
@RequestMapping("/api/user")
public class UserController {
    @Autowired
    private IUserService userService;

    @GetMapping("/searchByName")
    public List<UserStateDTO> searchByName(@RequestParam String username) {
        return userService.getUserByName(username);
    }
} 